Skip to content

refactor: remove dead TaskDependencyType and clean up task graph construction#283

Closed
yangshun wants to merge 1 commit intovoidzero-dev:mainfrom
yangshun:refactor/task-graph-cleanup
Closed

refactor: remove dead TaskDependencyType and clean up task graph construction#283
yangshun wants to merge 1 commit intovoidzero-dev:mainfrom
yangshun:refactor/task-graph-cleanup

Conversation

@yangshun
Copy link
Collaborator

Summary

  • Remove TaskDependencyType unit struct — all task graph edges are explicit dependsOn dependencies, so () suffices as edge weight
  • Simplify add_dependencies by removing the always-true filter_edge parameter
  • Construct TaskDisplay once per task instead of twice (once for error mapping, once for the node)
  • Fix zero-capacity pre-allocation — hash maps were sized to task_graph.node_count() which was always 0 at that point

Test plan

  • cargo test -p vite_task_graph — all 35 tests pass
  • cargo test -p vite_task_plan --test plan_snapshots — all cases pass
  • cargo check — full workspace compiles cleanly

🤖 Generated with Claude Code

…nstruction

- Remove `TaskDependencyType` unit struct — all task graph edges are
  explicit `dependsOn` dependencies, so `()` suffices as edge weight.
- Simplify `add_dependencies` by removing the now-unnecessary
  `filter_edge` parameter.
- Construct `TaskDisplay` once per task instead of twice (once for
  error mapping, once for the node).
- Fix zero-capacity pre-allocation in `IndexedTaskGraph::load` — the
  hash maps were sized to `task_graph.node_count()` which was always 0.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@yangshun yangshun marked this pull request as draft March 21, 2026 02:30
@yangshun yangshun closed this Mar 21, 2026
@yangshun yangshun deleted the refactor/task-graph-cleanup branch March 22, 2026 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant